package com.zhj.edu.exception.handler;

import com.zhj.edu.result.ResponseCode;
import lombok.Data;

/**
 * 该类为项目的业务异常类
 */
@Data
public class BusinessException extends RuntimeException{

    //状态码
    private Integer code;

    //错误的提示信息
    private String msg;

    public BusinessException(Integer code, String msg){
        this.code=code;
        this.msg=msg;
    }

    public BusinessException(ResponseCode responseCode) {
        this.code = responseCode.getCode();
        this.msg = responseCode.getMsg();
    }

}
